 <?php
	require_once("includes/db_connection.php");
	require_once("includes/functions.php");
	include("includes/header.php");
	
	if (isset($_GET['id'])) {
		$comp_id = $_GET['id'];
	}
?>

<table id="structure">
	<tr>
		<td id="navigation">
			<?php
				main_navigation();
			?>
		</td>
		<td id="page">
			<?php
			
			switch($action) {
				case "reklamacje":
					if($_COOKIE['superuser'] == 1) {
						main_complain_panel();
					} else {
						create_new_complaint();
						main_user_complain_panel($_COOKIE['user_id']);
					}
				break;
				case "reklamacja":
					get_complain($comp_id);
					get_posts($comp_id);
				break;
				case "reklamuj":
					new_complaint($_COOKIE['user_id']);
				break;
				default:
					main_panel_page();
				break;
			}
			
			?>
		</td>
	</tr>
</table>
<?php require("includes/footer.php"); ?>